<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" import="java.sql.*"%>
<%@ taglib prefix="t" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <title></title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/css/app.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/font-awesome-4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/css/subpage.css">

<script language="javascript">
 
	function openPopup() {
		//取消div的隐藏
		document.getElementById("myPopup").style.display = "";
	}
 
	function closePopup() {
		//关闭界面
		document.getElementById("myPopup").style.display = "none";
		history.go(0)
	}
	
	function greet(){//审核不通过,提交原因等到数据库
		document.getElementById("myPopup").style.display = "none";
		//这里改数据
		//````````
		history.go(0)
	}
	
	function agree(){//审核通过，状态刷新，改数据
		document.getElementById("myPopup").style.display = "none";
		//这里改数据
		//````````
		history.go(0)
	}
	
	function delete_(){//审核通过，状态刷新，改数据
		document.getElementById("myPopup").style.display = "none";
		//这里改数据
		//````````
		history.go(0)
	}
</script>
</head>
<body>
    <h1 class="callout">审核界面</h1>
    <h3><a href="${pageContext.request.contextPath}/admin/allAudit" class="wzc-btn">去浏览审核通过的帖子</a></h3>
    <div class="" style="text-align:center;">
        <table class="wzc-table">
            <tr>
                <th>模块名</th>
                <th>帖子ID</th>
                <th>帖子标题</th>
                <th>发帖时间</th>   
                <th>状态</th>  <%--未审核以及审核不通过 --%>
                <th>操作</th>
            </tr>
            <t:forEach items="${messageList}" var="message" varStatus="m" >
                <tr>
                    <td>${message.moduleName}</td>
                    <td>${message.messageID}</td>
                    <td>${message.messageName}</td>
                    <td>${message.postingTime}</td>
                    <td>${message.auditSatus}</td>
                        <%--for循环读入数据--%>
                    <td>
                        <a href="${pageContext.request.contextPath}/message/findMessageById?messageID=${message.messageID}">
                            <i class="fa fa-file fa-fw"></i> 详情</a>
                        <a href="${pageContext.request.contextPath}/admin/AuditFalse?messageID=${message.messageID}">
                            <i class="fa fa-edit fa-fw"></i> 不通过</a>
                        <a href="${pageContext.request.contextPath}/admin/AuditTrue?messageID=${message.messageID}">
                            <i class="fa fa-edit fa-fw"></i> 通过</a>
                        <a href="${pageContext.request.contextPath}/admin/deleteMessage?messageID=${message.messageID}">
                            <i class="fa fa-trash fa-fw"></i> 删除</a>
                    </td>
                </tr>
            </t:forEach>

       
        </table>
     </div>
     
     
    <%--div事先存在但被隐藏 --%>
	<div class="type1" id="myPopup" style="display: none">
	<font face="幼圆"><b>审核不通过原因</b></font>
	<br>
	<br>
	<input type="text" name="myText">
	<br>
	<br>
	<input type="button" class="type2" value="取消" onclick="closePopup()">
	<input type="button" class="type2" value="确定" onclick="greet()">
	</div>
</body>
</html>